package com.zzh.dp;

public class No70_climbStairs {
    public static void main(String[] args) {
        No70Solution solution=new No70Solution();
        int i = solution.climbStairs(5);
        System.out.println(i);
    }
}
class No70Solution {
    public int climbStairs(int n) {
        int[] f=new int[3];
        f[0]=1;
        f[1]=1;
        for (int i=2;i<=n;i++){
            f[i%3]=f[(i-1)%3]+f[(i-2)%3];
        }
        return f[n%3];
    }
}
